import static org.junit.Assert.*;

import java.util.LinkedList;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;


public class TableTest {

	@Test(expected = TableIncorrectNumberOfPlayersException.class)
	public void WhenNoPlayers_ExpectException() {
		Table t = new Table(null, new Deck(), 12);
	}

	@Test(expected = TableIncorrectNumberOfPlayersException.class)
	public void WhenTooLittlePlayers_ExpectException() {
		LinkedList<IPlayerStrategy> players = new LinkedList<IPlayerStrategy>();
		players.add(new BotStrategy("Bot1"));		
		Table t = new Table(players, new Deck(), 12);
	}
	
	@Test(expected = TableIncorrectNumberOfPlayersException.class)
	public void WhenTooManyPlayers_ExpectException (){
		LinkedList<IPlayerStrategy> players = new LinkedList<IPlayerStrategy>();
		players.add(new BotStrategy("Bot1"));
		players.add(new BotStrategy("Bot2"));
		players.add(new BotStrategy("Bot3"));
		players.add(new BotStrategy("Bot4"));
		players.add(new BotStrategy("Bot5"));
		players.add(new BotStrategy("Bot6"));
		players.add(new BotStrategy("Bot7"));
		players.add(new BotStrategy("Bot8"));
		Table t = new Table(players, new Deck(), 12);
	}
	
	@Test(expected = TableException.class)
	public void testTable4() {
		LinkedList<IPlayerStrategy> players = new LinkedList<IPlayerStrategy>();
		players.add(new BotStrategy("Bot1"));
		players.add(new BotStrategy("Bot2"));
		Table t = new Table(players, null, 12);
	}
}
